package cn.cloud.all.security.oauth2.client.filter;

import cn.cloud.all.security.authentication.AbstractAuthenticationToken;
import cn.cloud.all.security.authentication.event.AbstractAuthenticationFailureEvent;
import cn.cloud.all.security.core.AuthenticationException;

@SuppressWarnings("serial")
public class OAuth2AuthenticationFailureEvent extends AbstractAuthenticationFailureEvent {

    public OAuth2AuthenticationFailureEvent(AuthenticationException exception) {
        super(new FailedOAuthClientAuthentication(), exception);
    }
}

@SuppressWarnings("serial")
class FailedOAuthClientAuthentication extends AbstractAuthenticationToken {

    public FailedOAuthClientAuthentication() {
        super(null);
    }

    @Override
    public Object getCredentials() {
        return "";
    }

    @Override
    public Object getPrincipal() {
        return "UNKNOWN";
    }

}